﻿using Newtonsoft.Json;
using SimpleESBCore.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleESBCore.Implement.Serializer
{
    public class JSONSerializer : ISerialization
    {
        public T DeSerializer<T>(string source) where T:class
        {
            return JsonConvert.DeserializeObject(source,typeof(T)) as T;
        }

        public string Serializer<T>(T data) where T : class
        {
            return JsonConvert.SerializeObject(data);
        }
    }
}
